﻿@using MC.RideEvent.Mvc.Models.Repository
@model MC.RideEvent.Mvc.Models.ViewModel.PreferenceModel

<script src="~/Scripts/jquery-1.8.2.min.js"></script>
<script src="~/Scripts/jquery.validate.min.js"></script>
<script src="~/Scripts/jquery.validate.unobtrusive.min.js"></script>

@using (Html.BeginForm("PreferenceForm", "Member", FormMethod.Post))
{
    @Html.AntiForgeryToken()
    @Html.ValidationSummary(true)

    <fieldset>
        <legend>PreferenceModel</legend>
        
        @if (Model != null)
        {
            @Html.Hidden("Id", Model.Id)
        }

        <div class="editor-label">
            @Html.LabelFor(p => p.Age)
        </div>
        <div class="editor-field">
            @Html.TextBoxFor(p => p.Age)
            @Html.ValidationMessageFor(p => p.Age)
        </div>

        <div class="editor-label">
            @Html.LabelFor(p => p.Smoker)
        </div>
        <div class="editor-field">
            @Html.DropDownListFor(p => p.Smoker, SelectListRepository.ListOuiNon(false))
            @Html.ValidationMessageFor(p => p.Smoker)
        </div>
        
        <div class="editor-label">
            @Html.LabelFor(p => p.Music)
        </div>
        <div class="editor-field">
            @Html.DropDownListFor(p => p.Music, SelectListRepository.ListOuiNon(false))
            @Html.ValidationMessageFor(p => p.Music)
        </div>

        <div class="editor-label">
            @Html.LabelFor(p => p.DriverStyleId)
        </div>
        <div class="editor-field">
            @Html.DropDownListFor(p => p.DriverStyleId, SelectListRepository.ListDriverStyle())
            @Html.ValidationMessageFor(p => p.DriverStyleId)
        </div>

        <p>
            <input type="submit" value="Enregistrer" />
        </p>
    </fieldset>
}
